from django.db import models

class Student(models.Model):
    number = models.IntegerField()
    name = models.CharField(max_length=200)
    s_class = models.CharField(max_length=10)

    def __unicode__(self):
        return u"%s %s" % (self.name, self.s_class )

class Form(models.Model):
    owner = models.OneToOneField(Student)
    about_me = models.CharField(max_length=200)
    best_subject = models.CharField(max_length=200)
    story = models.TextField()

    def __unicode__(self):
        return u"by %s" % self.owner.__unicode__()

class CommentOnStudent(models.Model):
    form = models.ForeignKey(Form)
    student = models.ForeignKey(Student)
    comment = models.CharField(max_length=200)

    def __unicode__(self):
        return u"%s on %s: %s" % (self.form.__unicode__(), self.student.__unicode__(), self.comment[:20]) 


